My Profile_


Connection

There are some common steps for every transaction that is processed.

  1. Instantiate the transaction object (such as Purchase), and update it with object definitions that refer to the individual transaction.
  2. Instantiate the HttpsPostRequest connection object and update it with connection information, host information and the transaction object that you created in step 1. The HttpsPostRequest object and its mandatory variables apply to every transaction request.
  3. Invoke the HttpsPostRequest object's send() method.
  4. Instantiate the Receipt object, by invoking the HttpsPostRequest object's getReceipt() method. Use this object to retrieve the applicable response details.

Some transactions may require steps in addition to the ones listed here. For example, ACH transactions require the use of an ACHinfo object.

For an example of the full steps for each transaction, please refer to the individual transactions on this site.

HttpPostRequest Object

HttpsPostRequest mpgReq = new HttpsPostRequest();

HttpsPostRequest object mandatory values

Value Type Limits Set method Description
Processing country code String 2-character alphabetic mpgReq.setProcCountryCode(processing_country_code); CA for Canada
Test mode Boolean true/false mpgReq.setTestMode(true); Set to true when in test mode. Set to false (or comment out entire line) when in production mode.
Store ID String 10-character alphanumeric mpgReq.setStoreId(store_id); Unique identifier provided by Moneris upon merchant account set up.
API Token String 20-character alphanumeric mpgReq.setApiToken(api_token); Unique alphanumeric string assigned upon merchant account activation. To locate your production API token, refer to the Merchant Resource Centre Admin Store Settings. The Merchant Resource Centre may be located at the following CA URL
Transaction Object
mpgReq.setTransaction(transaction); Sets the transaction object that is to be processed.
HttpsPostRequest object optional values
Value Type Limits Set method Description
Status Check Boolean true/false mpgReq.setStatusCheck (status_check); Status Check is a connection object value that allows merchants to verify whether a previously sent transaction was processed successfully. To submit a Status Check request, resend the original transaction with all the same parameter values, but set the status check value to either true or false. Once set to “true”, the gateway will check the status of a transaction that has an order_id that matches the one passed.
  • If the transaction is found, the gateway will respond with the specifics of that transaction.
  • If the transaction is not found, the gateway will respond with a not found message.
  • Once it is set to “false”, the transaction will process as a new transaction.
Things to consider:
  • The Status Check request should only be used once and immediately (within 2 minutes) after the last transaction that had failed.
  • Do not resend the Status Check request if it has timed out. Additional investigation is required.